package hotel.menu.activity;

import hotel.menu.untils.ActivityUntil;

import com.example.youknow.R;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageView;

public class ShopCountent extends Activity implements OnClickListener {
	private Button todetaillist;
	private ImageView phone;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.shop_countent);
		findID();
	}

	private void findID() {
		todetaillist = (Button) this
				.findViewById(R.id.shop_countent_todetaillist);
		phone = (ImageView) this.findViewById(R.id.shop_countent_phone);
		todetaillist.setOnClickListener(this);
		phone.setOnClickListener(this);
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == 4) {
			ActivityUntil.back(ShopCountent.this);
		}
		return super.onKeyDown(keyCode, event);
	}

	@Override
	public void onClick(View v) {
		if (v == todetaillist) {
			ActivityUntil.back(ShopCountent.this);
		} else if (v == phone) {
			Intent intent = new Intent(Intent.ACTION_DIAL,
					Uri.parse("tel:15856387350"));
			intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			startActivity(intent);
		}

	}
}
